package main

import (
	"go.uber.org/zap"
	"go_es/server/core"
	"go_es/server/global"
	"go_es/server/initialize"
)

func main()  {
	global.GVA_VP = core.Viper()  //初始化Viper
	global.GVA_LOG = core.Zap() // 初始化zap日志库
	zap.ReplaceGlobals(global.GVA_LOG)

	global.GVA_DB = initialize.Gorm() // gorm连接数据库
	initialize.DBList()
	//initialize.RabbitMqConnection()  //连接rabbitMQ
	//GenSpecialModel("auth_admin")
	if global.GVA_DB != nil {
		//initialize.RegisterTables(global.GVA_DB) // 初始化表
		db, _ := global.GVA_DB.DB()
		// 程序结束前关闭数据库链接
		defer db.Close()
	}
	core.RunWindowsServer()
}
